# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models


class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding model 'ConnieRun'
        db.create_table('connie2_connierun', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('isSource', self.gf('django.db.models.fields.BooleanField')(default=True)),
            ('spawningFromDate', self.gf('django.db.models.fields.DateField')()),
            ('spawningToDate', self.gf('django.db.models.fields.DateField')()),
            ('regions', self.gf('django.contrib.gis.db.models.fields.MultiPolygonField')(null=True)),
            ('boundingBox', self.gf('django.contrib.gis.db.models.fields.PolygonField')(null=True)),
            ('creationTime', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),
            ('velocityFields', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['connie2.VelocityFields'])),
        ))
        db.send_create_signal('connie2', ['ConnieRun'])

        # Adding M2M table for field years on 'ConnieRun'
        db.create_table('connie2_connierun_years', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('connierun', models.ForeignKey(orm['connie2.connierun'], null=False)),
            ('yearforaveraging', models.ForeignKey(orm['connie2.yearforaveraging'], null=False))
        ))
        db.create_unique('connie2_connierun_years', ['connierun_id', 'yearforaveraging_id'])

        # Adding model 'LarvalPhase'
        db.create_table('connie2_larvalphase', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('connieRun', self.gf('django.db.models.fields.related.ForeignKey')(related_name='larvalPhases', to=orm['connie2.ConnieRun'])),
            ('phaseNumber', self.gf('django.db.models.fields.IntegerField')(default=1)),
            ('phaseLongevity', self.gf('django.db.models.fields.IntegerField')()),
            ('northwardPropulsion', self.gf('django.db.models.fields.FloatField')(default=0)),
            ('eastwardPropulsion', self.gf('django.db.models.fields.FloatField')(default=0)),
            ('randomPropulsion', self.gf('django.db.models.fields.FloatField')(default=0)),
            ('windspeedPropulsion', self.gf('django.db.models.fields.FloatField')(default=0)),
        ))
        db.send_create_signal('connie2', ['LarvalPhase'])

        # Adding model 'LarvalPhaseLevel'
        db.create_table('connie2_larvalphaselevel', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('larvalPhase', self.gf('django.db.models.fields.related.ForeignKey')(related_name='levels', to=orm['connie2.LarvalPhase'])),
            ('verticalLevel', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['connie2.VelocityFieldsDepth'])),
            ('period', self.gf('django.db.models.fields.IntegerField')(default=5)),
        ))
        db.send_create_signal('connie2', ['LarvalPhaseLevel'])

        # Adding model 'YearForAveraging'
        db.create_table('connie2_yearforaveraging', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('year', self.gf('django.db.models.fields.PositiveSmallIntegerField')(unique=True)),
        ))
        db.send_create_signal('connie2', ['YearForAveraging'])

        # Adding model 'VelocityFields'
        db.create_table('connie2_velocityfields', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('key', self.gf('django.db.models.fields.CharField')(max_length=20, unique=True, null=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=50, unique=True, null=True)),
            ('cellWidth', self.gf('django.db.models.fields.FloatField')()),
            ('cellHeight', self.gf('django.db.models.fields.FloatField')()),
            ('bounds', self.gf('django.contrib.gis.db.models.fields.PolygonField')(null=True)),
            ('minDate', self.gf('django.db.models.fields.DateField')()),
            ('maxDate', self.gf('django.db.models.fields.DateField')()),
        ))
        db.send_create_signal('connie2', ['VelocityFields'])

        # Adding M2M table for field depths on 'VelocityFields'
        db.create_table('connie2_velocityfields_depths', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('velocityfields', models.ForeignKey(orm['connie2.velocityfields'], null=False)),
            ('velocityfieldsdepth', models.ForeignKey(orm['connie2.velocityfieldsdepth'], null=False))
        ))
        db.create_unique('connie2_velocityfields_depths', ['velocityfields_id', 'velocityfieldsdepth_id'])

        # Adding model 'VelocityFieldsDepth'
        db.create_table('connie2_velocityfieldsdepth', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('depth', self.gf('django.db.models.fields.IntegerField')(unique=True)),
        ))
        db.send_create_signal('connie2', ['VelocityFieldsDepth'])


    def backwards(self, orm):
        # Deleting model 'ConnieRun'
        db.delete_table('connie2_connierun')

        # Removing M2M table for field years on 'ConnieRun'
        db.delete_table('connie2_connierun_years')

        # Deleting model 'LarvalPhase'
        db.delete_table('connie2_larvalphase')

        # Deleting model 'LarvalPhaseLevel'
        db.delete_table('connie2_larvalphaselevel')

        # Deleting model 'YearForAveraging'
        db.delete_table('connie2_yearforaveraging')

        # Deleting model 'VelocityFields'
        db.delete_table('connie2_velocityfields')

        # Removing M2M table for field depths on 'VelocityFields'
        db.delete_table('connie2_velocityfields_depths')

        # Deleting model 'VelocityFieldsDepth'
        db.delete_table('connie2_velocityfieldsdepth')


    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True', 'null': 'True'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.Permission']", 'null': 'True', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.Group']", 'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.Permission']", 'null': 'True', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True', 'null': 'True'})
        },
        'connie2.connierun': {
            'Meta': {'object_name': 'ConnieRun'},
            'boundingBox': ('django.contrib.gis.db.models.fields.PolygonField', [], {'null': 'True'}),
            'creationTime': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'isSource': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'regions': ('django.contrib.gis.db.models.fields.MultiPolygonField', [], {'null': 'True'}),
            'spawningFromDate': ('django.db.models.fields.DateField', [], {}),
            'spawningToDate': ('django.db.models.fields.DateField', [], {}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
            'velocityFields': ('django.db.models.fields.related.ForeignKey', [], {'default': '1', 'to': "orm['connie2.VelocityFields']"}),
            'years': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['connie2.YearForAveraging']", 'null': 'True', 'symmetrical': 'False'})
        },
        'connie2.larvalphase': {
            'Meta': {'object_name': 'LarvalPhase'},
            'connieRun': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'larvalPhases'", 'to': "orm['connie2.ConnieRun']"}),
            'eastwardPropulsion': ('django.db.models.fields.FloatField', [], {'default': '0'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'northwardPropulsion': ('django.db.models.fields.FloatField', [], {'default': '0'}),
            'phaseLongevity': ('django.db.models.fields.IntegerField', [], {}),
            'phaseNumber': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
            'randomPropulsion': ('django.db.models.fields.FloatField', [], {'default': '0'}),
            'windspeedPropulsion': ('django.db.models.fields.FloatField', [], {'default': '0'})
        },
        'connie2.larvalphaselevel': {
            'Meta': {'object_name': 'LarvalPhaseLevel'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'larvalPhase': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'levels'", 'to': "orm['connie2.LarvalPhase']"}),
            'period': ('django.db.models.fields.IntegerField', [], {'default': '5'}),
            'verticalLevel': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['connie2.VelocityFieldsDepth']"})
        },
        'connie2.velocityfields': {
            'Meta': {'object_name': 'VelocityFields'},
            'bounds': ('django.contrib.gis.db.models.fields.PolygonField', [], {'null': 'True'}),
            'cellHeight': ('django.db.models.fields.FloatField', [], {}),
            'cellWidth': ('django.db.models.fields.FloatField', [], {}),
            'depths': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['connie2.VelocityFieldsDepth']", 'null': 'True', 'symmetrical': 'False'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'key': ('django.db.models.fields.CharField', [], {'max_length': '20', 'unique': 'True', 'null': 'True'}),
            'maxDate': ('django.db.models.fields.DateField', [], {}),
            'minDate': ('django.db.models.fields.DateField', [], {}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'unique': 'True', 'null': 'True'})
        },
        'connie2.velocityfieldsdepth': {
            'Meta': {'ordering': "('depth',)", 'object_name': 'VelocityFieldsDepth'},
            'depth': ('django.db.models.fields.IntegerField', [], {'unique': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
        },
        'connie2.yearforaveraging': {
            'Meta': {'object_name': 'YearForAveraging'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'year': ('django.db.models.fields.PositiveSmallIntegerField', [], {'unique': 'True'})
        },
        'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'})
        }
    }

    complete_apps = ['connie2']